using System;
using UnityEngine;

namespace MaterialUI
{
	public static class Tween
	{
		public enum TweenType
		{
			Custom,
			Linear,
			Overshoot,
			Bounce,
			EaseInCubed,
			EaseInQuint,
			EaseInSept,
			EaseOutCubed,
			EaseOutQuint,
			EaseOutSept,
			EaseInOutCubed,
			EaseInOutQuint,
			EaseInOutSept,
			SoftEaseOutCubed,
			SoftEaseOutQuint,
			SoftEaseOutSept
		}

		public static float[][] GetAnimCurveKeys(TweenType tweenType)
		{
			float[][] array = (tweenType != TweenType.Linear) ? new float[11][]
			{
				new float[2],
				new float[2]
				{
					0.1f,
					0f
				},
				new float[2]
				{
					0.2f,
					0f
				},
				new float[2]
				{
					0.3f,
					0f
				},
				new float[2]
				{
					0.4f,
					0f
				},
				new float[2]
				{
					0.5f,
					0f
				},
				new float[2]
				{
					0.6f,
					0f
				},
				new float[2]
				{
					0.7f,
					0f
				},
				new float[2]
				{
					0.8f,
					0f
				},
				new float[2]
				{
					0.9f,
					0f
				},
				new float[2]
				{
					1f,
					0f
				}
			} : new float[2][]
			{
				new float[2],
				new float[2]
				{
					1f,
					1f
				}
			};
			float num = array.Length;
			switch (tweenType)
			{
			case TweenType.Overshoot:
				for (int num7 = 0; num7 < array.Length; num7++)
				{
					array[num7][1] = Overshoot(0f, 1f, (float)num7 / num, 1f);
				}
				break;
			case TweenType.Bounce:
				for (int l = 0; l < array.Length; l++)
				{
					array[l][1] = Bounce(0f, 1f, (float)l / num, 1f);
				}
				break;
			case TweenType.EaseInCubed:
				for (int num3 = 0; num3 < array.Length; num3++)
				{
					array[num3][1] = CubeIn(0f, 1f, (float)num3 / num, 1f);
				}
				break;
			case TweenType.EaseOutCubed:
				for (int num9 = 0; num9 < array.Length; num9++)
				{
					array[num9][1] = CubeOut(0f, 1f, (float)num9 / num, 1f);
				}
				break;
			case TweenType.SoftEaseOutCubed:
				for (int num5 = 0; num5 < array.Length; num5++)
				{
					array[num5][1] = CubeSoftOut(0f, 1f, (float)num5 / num, 1f);
				}
				break;
			case TweenType.EaseInOutCubed:
				for (int n = 0; n < array.Length; n++)
				{
					array[n][1] = CubeInOut(0f, 1f, (float)n / num, 1f);
				}
				break;
			case TweenType.EaseInQuint:
				for (int j = 0; j < array.Length; j++)
				{
					array[j][1] = QuintIn(0f, 1f, (float)j / num, 1f);
				}
				break;
			case TweenType.EaseOutQuint:
				for (int num8 = 0; num8 < array.Length; num8++)
				{
					array[num8][1] = QuintOut(0f, 1f, (float)num8 / num, 1f);
				}
				break;
			case TweenType.SoftEaseOutQuint:
				for (int num6 = 0; num6 < array.Length; num6++)
				{
					array[num6][1] = QuintSoftOut(0f, 1f, (float)num6 / num, 1f);
				}
				break;
			case TweenType.EaseInOutQuint:
				for (int num4 = 0; num4 < array.Length; num4++)
				{
					array[num4][1] = QuintInOut(0f, 1f, (float)num4 / num, 1f);
				}
				break;
			case TweenType.EaseInSept:
				for (int num2 = 0; num2 < array.Length; num2++)
				{
					array[num2][1] = SeptIn(0f, 1f, (float)num2 / num, 1f);
				}
				break;
			case TweenType.EaseOutSept:
				for (int m = 0; m < array.Length; m++)
				{
					array[m][1] = SeptOut(0f, 1f, (float)m / num, 1f);
				}
				break;
			case TweenType.SoftEaseOutSept:
				for (int k = 0; k < array.Length; k++)
				{
					array[k][1] = SeptSoftOut(0f, 1f, (float)k / num, 1f);
				}
				break;
			case TweenType.EaseInOutSept:
				for (int i = 0; i < array.Length; i++)
				{
					array[i][1] = SeptInOut(0f, 1f, (float)i / num, 1f);
				}
				break;
			}
			return array;
		}

		public static AnimationCurve CheckCurve(AnimationCurve curve)
		{
			if (curve.keys.Length < 2)
			{
				curve = new AnimationCurve(new Keyframe(0f, 0f), new Keyframe(1f, 1f));
			}
			else if (curve.keys[0].time != 0f || curve.keys[curve.keys.Length - 1].time != 1f)
			{
				curve = new AnimationCurve(new Keyframe(0f, 0f), new Keyframe(1f, 1f));
			}
			return curve;
		}

		public static float Evaluate(TweenType type, float startValue, float endValue, float time, float duration, AnimationCurve curve = null)
		{
			switch (type)
			{
			case TweenType.Linear:
				return Linear(startValue, endValue, time, duration);
			case TweenType.Overshoot:
				return Overshoot(startValue, endValue, time, duration);
			case TweenType.Bounce:
				return Bounce(startValue, endValue, time, duration);
			case TweenType.EaseInCubed:
				return CubeIn(startValue, endValue, time, duration);
			case TweenType.EaseInQuint:
				return QuintIn(startValue, endValue, time, duration);
			case TweenType.EaseInSept:
				return SeptIn(startValue, endValue, time, duration);
			case TweenType.EaseOutCubed:
				return CubeOut(startValue, endValue, time, duration);
			case TweenType.EaseOutQuint:
				return QuintOut(startValue, endValue, time, duration);
			case TweenType.EaseOutSept:
				return SeptOut(startValue, endValue, time, duration);
			case TweenType.EaseInOutCubed:
				return CubeInOut(startValue, endValue, time, duration);
			case TweenType.EaseInOutQuint:
				return QuintInOut(startValue, endValue, time, duration);
			case TweenType.EaseInOutSept:
				return SeptInOut(startValue, endValue, time, duration);
			case TweenType.SoftEaseOutCubed:
				return CubeSoftOut(startValue, endValue, time, duration);
			case TweenType.SoftEaseOutQuint:
				return QuintSoftOut(startValue, endValue, time, duration);
			case TweenType.SoftEaseOutSept:
				return SeptSoftOut(startValue, endValue, time, duration);
			case TweenType.Custom:
				return (endValue - startValue) * curve.Evaluate(time / duration) + startValue;
			default:
				return 0f;
			}
		}

		public static float Linear(float startValue, float endValue, float time, float duration)
		{
			float num = endValue - startValue;
			time = Mathf.Clamp(time, 0f, duration);
			time /= duration;
			if (time == 0f)
			{
				return startValue;
			}
			if (time == 1f)
			{
				return endValue;
			}
			return num * time + startValue;
		}

		public static Vector2 Linear(Vector2 startValue, Vector2 endValue, float time, float duration)
		{
			Vector2 result = startValue;
			result.x = Linear(startValue.x, endValue.x, time, duration);
			result.y = Linear(startValue.y, endValue.y, time, duration);
			return result;
		}

		public static Vector3 Linear(Vector3 startValue, Vector3 endValue, float time, float duration)
		{
			Vector3 result = startValue;
			result.x = Linear(startValue.x, endValue.x, time, duration);
			result.y = Linear(startValue.y, endValue.y, time, duration);
			result.z = Linear(startValue.z, endValue.z, time, duration);
			return result;
		}

		public static Color Linear(Color startValue, Color endValue, float time, float duration)
		{
			Color result = startValue;
			result.r = Linear(startValue.r, endValue.r, time, duration);
			result.g = Linear(startValue.g, endValue.g, time, duration);
			result.b = Linear(startValue.b, endValue.b, time, duration);
			result.a = Linear(startValue.a, endValue.a, time, duration);
			return result;
		}

		public static float Sin(float startValue, float amplitude, float time)
		{
			return Mathf.Cos(time) * amplitude + startValue;
		}

		public static Vector2 Sin(Vector2 startValue, Vector2 amplitude, float time)
		{
			Vector2 result = startValue;
			result.x = Sin(startValue.x, amplitude.x, time);
			result.y = Sin(startValue.y, amplitude.y, time);
			return result;
		}

		public static Vector3 Sin(Vector3 startValue, Vector3 amplitude, float time)
		{
			Vector3 result = startValue;
			result.x = Sin(startValue.x, amplitude.x, time);
			result.y = Sin(startValue.y, amplitude.y, time);
			result.z = Sin(startValue.z, amplitude.z, time);
			return result;
		}

		public static Color Sin(Color startValue, Color amplitude, float time)
		{
			Color result = startValue;
			result.r = Sin(startValue.r, amplitude.r, time);
			result.g = Sin(startValue.g, amplitude.g, time);
			result.b = Sin(startValue.b, amplitude.b, time);
			result.a = Sin(startValue.a, amplitude.a, time);
			return result;
		}

		public static float Overshoot(float startValue, float endValue, float time, float duration)
		{
			float num = endValue - startValue;
			time = Mathf.Clamp(time, 0f, duration);
			time /= duration;
			if (time == 0f)
			{
				return startValue;
			}
			if (time == 1f)
			{
				return endValue;
			}
			if (time < 0.6069f)
			{
				return num * ((0f - Mathf.Sin((float)Math.PI * 2f * time * time)) / ((float)Math.PI * 2f * time * time) + 1f) + startValue;
			}
			if (time < 0.8586f)
			{
				return num * (0f - 6.7f * Mathf.Pow(time - 0.8567f, 2f) + 1.1f) + startValue;
			}
			return num * (5f * Mathf.Pow(time - 1f, 2f) + 1f) + startValue;
		}

		public static Vector2 Overshoot(Vector2 startValue, Vector2 endValue, float time, float duration)
		{
			Vector2 result = startValue;
			result.x = Overshoot(startValue.x, endValue.x, time, duration);
			result.y = Overshoot(startValue.y, endValue.y, time, duration);
			return result;
		}

		public static Vector3 Overshoot(Vector3 startValue, Vector3 endValue, float time, float duration)
		{
			Vector3 result = startValue;
			result.x = Overshoot(startValue.x, endValue.x, time, duration);
			result.y = Overshoot(startValue.y, endValue.y, time, duration);
			result.z = Overshoot(startValue.z, endValue.z, time, duration);
			return result;
		}

		public static Color Overshoot(Color startValue, Color endValue, float time, float duration)
		{
			Color result = startValue;
			result.r = Overshoot(startValue.r, endValue.r, time, duration);
			result.g = Overshoot(startValue.g, endValue.g, time, duration);
			result.b = Overshoot(startValue.b, endValue.b, time, duration);
			result.a = Overshoot(startValue.a, endValue.a, time, duration);
			return result;
		}

		public static float Bounce(float startValue, float endValue, float time, float duration)
		{
			float num = endValue - startValue;
			time = Mathf.Clamp(time, 0f, duration);
			time /= duration;
			if (time == 0f)
			{
				return startValue;
			}
			if (time == 1f)
			{
				return endValue;
			}
			if (time < 0.75f)
			{
				return num * (3.16f * time * time * time * time) + startValue;
			}
			return num * (8f * Mathf.Pow(time - 0.875f, 2f) + 0.875f) + startValue;
		}

		public static Vector2 Bounce(Vector2 startValue, Vector2 endValue, float time, float duration)
		{
			Vector2 result = startValue;
			result.x = Bounce(startValue.x, endValue.x, time, duration);
			result.y = Bounce(startValue.y, endValue.y, time, duration);
			return result;
		}

		public static Vector3 Bounce(Vector3 startValue, Vector3 endValue, float time, float duration)
		{
			Vector3 result = startValue;
			result.x = Bounce(startValue.x, endValue.x, time, duration);
			result.y = Bounce(startValue.y, endValue.y, time, duration);
			result.z = Bounce(startValue.z, endValue.z, time, duration);
			return result;
		}

		public static Color Bounce(Color startValue, Color endValue, float time, float duration)
		{
			Color result = startValue;
			result.r = Bounce(startValue.r, endValue.r, time, duration);
			result.g = Bounce(startValue.g, endValue.g, time, duration);
			result.b = Bounce(startValue.b, endValue.b, time, duration);
			result.a = Bounce(startValue.a, endValue.a, time, duration);
			return result;
		}

		public static float CubeIn(float startValue, float endValue, float time, float duration)
		{
			float num = endValue - startValue;
			time = Mathf.Clamp(time, 0f, duration);
			time /= duration;
			if (time == 0f)
			{
				return startValue;
			}
			if (time == 1f)
			{
				return endValue;
			}
			return num * time * time * time + startValue;
		}

		public static Vector2 CubeIn(Vector2 startValue, Vector2 endValue, float time, float duration)
		{
			Vector2 result = startValue;
			result.x = CubeIn(startValue.x, endValue.x, time, duration);
			result.y = CubeIn(startValue.y, endValue.y, time, duration);
			return result;
		}

		public static Vector3 CubeIn(Vector3 startValue, Vector3 endValue, float time, float duration)
		{
			Vector3 result = startValue;
			result.x = CubeIn(startValue.x, endValue.x, time, duration);
			result.y = CubeIn(startValue.y, endValue.y, time, duration);
			result.z = CubeIn(startValue.z, endValue.z, time, duration);
			return result;
		}

		public static Color CubeIn(Color startValue, Color endValue, float time, float duration)
		{
			Color result = startValue;
			result.r = CubeIn(startValue.r, endValue.r, time, duration);
			result.g = CubeIn(startValue.g, endValue.g, time, duration);
			result.b = CubeIn(startValue.b, endValue.b, time, duration);
			result.a = CubeIn(startValue.a, endValue.a, time, duration);
			return result;
		}

		public static float CubeOut(float startValue, float endValue, float time, float duration)
		{
			float num = endValue - startValue;
			time = Mathf.Clamp(time, 0f, duration);
			time /= duration;
			if (time == 0f)
			{
				return startValue;
			}
			if (time == 1f)
			{
				return endValue;
			}
			time -= 1f;
			return num * (time * time * time + 1f) + startValue;
		}

		public static Vector2 CubeOut(Vector2 startValue, Vector2 endValue, float time, float duration)
		{
			Vector2 result = startValue;
			result.x = CubeOut(startValue.x, endValue.x, time, duration);
			result.y = CubeOut(startValue.y, endValue.y, time, duration);
			return result;
		}

		public static Vector3 CubeOut(Vector3 startValue, Vector3 endValue, float time, float duration)
		{
			Vector3 result = startValue;
			result.x = CubeOut(startValue.x, endValue.x, time, duration);
			result.y = CubeOut(startValue.y, endValue.y, time, duration);
			result.z = CubeOut(startValue.z, endValue.z, time, duration);
			return result;
		}

		public static Color CubeOut(Color startValue, Color endValue, float time, float duration)
		{
			Color result = startValue;
			result.r = CubeOut(startValue.r, endValue.r, time, duration);
			result.g = CubeOut(startValue.g, endValue.g, time, duration);
			result.b = CubeOut(startValue.b, endValue.b, time, duration);
			result.a = CubeOut(startValue.a, endValue.a, time, duration);
			return result;
		}

		public static float CubeInOut(float startValue, float endValue, float time, float duration)
		{
			float num = endValue - startValue;
			time = Mathf.Clamp(time, 0f, duration);
			time /= duration / 2f;
			if (time == 0f)
			{
				return startValue;
			}
			if (time == 1f)
			{
				return endValue;
			}
			if (time < 1f)
			{
				return num / 2f * time * time * time + startValue;
			}
			time -= 2f;
			return num / 2f * (time * time * time + 2f) + startValue;
		}

		public static Vector2 CubeInOut(Vector2 startValue, Vector2 endValue, float time, float duration)
		{
			Vector2 result = startValue;
			result.x = CubeInOut(startValue.x, endValue.x, time, duration);
			result.y = CubeInOut(startValue.y, endValue.y, time, duration);
			return result;
		}

		public static Vector3 CubeInOut(Vector3 startValue, Vector3 endValue, float time, float duration)
		{
			Vector3 result = startValue;
			result.x = CubeInOut(startValue.x, endValue.x, time, duration);
			result.y = CubeInOut(startValue.y, endValue.y, time, duration);
			result.z = CubeInOut(startValue.z, endValue.z, time, duration);
			return result;
		}

		public static Color CubeInOut(Color startValue, Color endValue, float time, float duration)
		{
			Color result = startValue;
			result.r = CubeInOut(startValue.r, endValue.r, time, duration);
			result.g = CubeInOut(startValue.g, endValue.g, time, duration);
			result.b = CubeInOut(startValue.b, endValue.b, time, duration);
			result.a = CubeInOut(startValue.a, endValue.a, time, duration);
			return result;
		}

		public static float CubeSoftOut(float startValue, float endValue, float time, float duration)
		{
			float num = endValue - startValue;
			time = Mathf.Clamp(time, 0f, duration);
			time /= duration / 2f;
			if (time == 0f)
			{
				return startValue;
			}
			if (time == 0.5f)
			{
				return endValue;
			}
			if (time < 0.559f)
			{
				return num / 2f * time * time * time * time * time * time * time * 16f + startValue;
			}
			time -= 2f;
			return num / 2f * (time * time * time * 0.5772f + 2f) + startValue;
		}

		public static Vector2 CubeSoftOut(Vector2 startValue, Vector2 endValue, float time, float duration)
		{
			Vector2 result = startValue;
			result.x = CubeSoftOut(startValue.x, endValue.x, time, duration);
			result.y = CubeSoftOut(startValue.y, endValue.y, time, duration);
			return result;
		}

		public static Vector3 CubeSoftOut(Vector3 startValue, Vector3 endValue, float time, float duration)
		{
			Vector3 result = startValue;
			result.x = CubeSoftOut(startValue.x, endValue.x, time, duration);
			result.y = CubeSoftOut(startValue.y, endValue.y, time, duration);
			result.z = CubeSoftOut(startValue.z, endValue.z, time, duration);
			return result;
		}

		public static Color CubeSoftOut(Color startValue, Color endValue, float time, float duration)
		{
			Color result = startValue;
			result.r = CubeSoftOut(startValue.r, endValue.r, time, duration);
			result.g = CubeSoftOut(startValue.g, endValue.g, time, duration);
			result.b = CubeSoftOut(startValue.b, endValue.b, time, duration);
			result.a = CubeSoftOut(startValue.a, endValue.a, time, duration);
			return result;
		}

		public static float QuintIn(float startValue, float endValue, float time, float duration)
		{
			float num = endValue - startValue;
			time = Mathf.Clamp(time, 0f, duration);
			time /= duration;
			if (time == 0f)
			{
				return startValue;
			}
			if (time == 1f)
			{
				return endValue;
			}
			return num * time * time * time * time * time + startValue;
		}

		public static Vector2 QuintIn(Vector2 startValue, Vector2 endValue, float time, float duration)
		{
			Vector2 result = startValue;
			result.x = QuintIn(startValue.x, endValue.x, time, duration);
			result.y = QuintIn(startValue.y, endValue.y, time, duration);
			return result;
		}

		public static Vector3 QuintIn(Vector3 startValue, Vector3 endValue, float time, float duration)
		{
			Vector3 result = startValue;
			result.x = QuintIn(startValue.x, endValue.x, time, duration);
			result.y = QuintIn(startValue.y, endValue.y, time, duration);
			result.z = QuintIn(startValue.z, endValue.z, time, duration);
			return result;
		}

		public static Color QuintIn(Color startValue, Color endValue, float time, float duration)
		{
			Color result = startValue;
			result.r = QuintIn(startValue.r, endValue.r, time, duration);
			result.g = QuintIn(startValue.g, endValue.g, time, duration);
			result.b = QuintIn(startValue.b, endValue.b, time, duration);
			result.a = QuintIn(startValue.a, endValue.a, time, duration);
			return result;
		}

		public static float QuintOut(float startValue, float endValue, float time, float duration)
		{
			float num = endValue - startValue;
			time = Mathf.Clamp(time, 0f, duration);
			time /= duration;
			if (time == 0f)
			{
				return startValue;
			}
			if (time == 1f)
			{
				return endValue;
			}
			time -= 1f;
			return num * (time * time * time * time * time + 1f) + startValue;
		}

		public static Vector2 QuintOut(Vector2 startValue, Vector2 endValue, float time, float duration)
		{
			Vector2 result = startValue;
			result.x = QuintOut(startValue.x, endValue.x, time, duration);
			result.y = QuintOut(startValue.y, endValue.y, time, duration);
			return result;
		}

		public static Vector3 QuintOut(Vector3 startValue, Vector3 endValue, float time, float duration)
		{
			Vector3 result = startValue;
			result.x = QuintOut(startValue.x, endValue.x, time, duration);
			result.y = QuintOut(startValue.y, endValue.y, time, duration);
			result.z = QuintOut(startValue.z, endValue.z, time, duration);
			return result;
		}

		public static Color QuintOut(Color startValue, Color endValue, float time, float duration)
		{
			Color result = startValue;
			result.r = QuintOut(startValue.r, endValue.r, time, duration);
			result.g = QuintOut(startValue.g, endValue.g, time, duration);
			result.b = QuintOut(startValue.b, endValue.b, time, duration);
			result.a = QuintOut(startValue.a, endValue.a, time, duration);
			return result;
		}

		public static float QuintInOut(float startValue, float endValue, float time, float duration)
		{
			float num = endValue - startValue;
			time = Mathf.Clamp(time, 0f, duration);
			time /= duration / 2f;
			if (time == 0f)
			{
				return startValue;
			}
			if (time == 1f)
			{
				return endValue;
			}
			if (time < 1f)
			{
				return num / 2f * time * time * time * time * time + startValue;
			}
			time -= 2f;
			return num / 2f * (time * time * time * time * time + 2f) + startValue;
		}

		public static Vector2 QuintInOut(Vector2 startValue, Vector2 endValue, float time, float duration)
		{
			Vector2 result = startValue;
			result.x = QuintInOut(startValue.x, endValue.x, time, duration);
			result.y = QuintInOut(startValue.y, endValue.y, time, duration);
			return result;
		}

		public static Vector3 QuintInOut(Vector3 startValue, Vector3 endValue, float time, float duration)
		{
			Vector3 result = startValue;
			result.x = QuintInOut(startValue.x, endValue.x, time, duration);
			result.y = QuintInOut(startValue.y, endValue.y, time, duration);
			result.z = QuintInOut(startValue.z, endValue.z, time, duration);
			return result;
		}

		public static Color QuintInOut(Color startValue, Color endValue, float time, float duration)
		{
			Color result = startValue;
			result.r = QuintInOut(startValue.r, endValue.r, time, duration);
			result.g = QuintInOut(startValue.g, endValue.g, time, duration);
			result.b = QuintInOut(startValue.b, endValue.b, time, duration);
			result.a = QuintInOut(startValue.a, endValue.a, time, duration);
			return result;
		}

		public static float QuintSoftOut(float startValue, float endValue, float time, float duration)
		{
			float num = endValue - startValue;
			time = Mathf.Clamp(time, 0f, duration);
			time /= duration / 2f;
			if (time == 0f)
			{
				return startValue;
			}
			if (time == 0.5f)
			{
				return endValue;
			}
			if (time < 0.497f)
			{
				return num / 2f * time * time * time * time * time * 16f + startValue;
			}
			time -= 2f;
			return num / 2f * (time * time * time * time * time * 0.1975f + 2f) + startValue;
		}

		public static Vector2 QuintSoftOut(Vector2 startValue, Vector2 endValue, float time, float duration)
		{
			Vector2 result = startValue;
			result.x = QuintSoftOut(startValue.x, endValue.x, time, duration);
			result.y = QuintSoftOut(startValue.y, endValue.y, time, duration);
			return result;
		}

		public static Vector3 QuintSoftOut(Vector3 startValue, Vector3 endValue, float time, float duration)
		{
			Vector3 result = startValue;
			result.x = QuintSoftOut(startValue.x, endValue.x, time, duration);
			result.y = QuintSoftOut(startValue.y, endValue.y, time, duration);
			result.z = QuintSoftOut(startValue.z, endValue.z, time, duration);
			return result;
		}

		public static Color QuintSoftOut(Color startValue, Color endValue, float time, float duration)
		{
			Color result = startValue;
			result.r = QuintSoftOut(startValue.r, endValue.r, time, duration);
			result.g = QuintSoftOut(startValue.g, endValue.g, time, duration);
			result.b = QuintSoftOut(startValue.b, endValue.b, time, duration);
			result.a = QuintSoftOut(startValue.a, endValue.a, time, duration);
			return result;
		}

		public static float SeptIn(float startValue, float endValue, float time, float duration)
		{
			float num = endValue - startValue;
			time = Mathf.Clamp(time, 0f, duration);
			time /= duration;
			if (time == 0f)
			{
				return startValue;
			}
			if (time == 1f)
			{
				return endValue;
			}
			return num * time * time * time * time * time * time * time + startValue;
		}

		public static Vector2 SeptIn(Vector2 startValue, Vector2 endValue, float time, float duration)
		{
			Vector2 result = startValue;
			result.x = SeptIn(startValue.x, endValue.x, time, duration);
			result.y = SeptIn(startValue.y, endValue.y, time, duration);
			return result;
		}

		public static Vector3 SeptIn(Vector3 startValue, Vector3 endValue, float time, float duration)
		{
			Vector3 result = startValue;
			result.x = SeptIn(startValue.x, endValue.x, time, duration);
			result.y = SeptIn(startValue.y, endValue.y, time, duration);
			result.z = SeptIn(startValue.z, endValue.z, time, duration);
			return result;
		}

		public static Color SeptIn(Color startValue, Color endValue, float time, float duration)
		{
			Color result = startValue;
			result.r = SeptIn(startValue.r, endValue.r, time, duration);
			result.g = SeptIn(startValue.g, endValue.g, time, duration);
			result.b = SeptIn(startValue.b, endValue.b, time, duration);
			result.a = SeptIn(startValue.a, endValue.a, time, duration);
			return result;
		}

		public static float SeptOut(float startValue, float endValue, float time, float duration)
		{
			float num = endValue - startValue;
			time = Mathf.Clamp(time, 0f, duration);
			time /= duration;
			if (time == 0f)
			{
				return startValue;
			}
			if (time == 1f)
			{
				return endValue;
			}
			time -= 1f;
			return num * (time * time * time * time * time * time * time + 1f) + startValue;
		}

		public static Vector2 SeptOut(Vector2 startValue, Vector2 endValue, float time, float duration)
		{
			Vector2 result = startValue;
			result.x = SeptOut(startValue.x, endValue.x, time, duration);
			result.y = SeptOut(startValue.y, endValue.y, time, duration);
			return result;
		}

		public static Vector3 SeptOut(Vector3 startValue, Vector3 endValue, float time, float duration)
		{
			Vector3 result = startValue;
			result.x = SeptOut(startValue.x, endValue.x, time, duration);
			result.y = SeptOut(startValue.y, endValue.y, time, duration);
			result.z = SeptOut(startValue.z, endValue.z, time, duration);
			return result;
		}

		public static Color SeptOut(Color startValue, Color endValue, float time, float duration)
		{
			Color result = startValue;
			result.r = SeptOut(startValue.r, endValue.r, time, duration);
			result.g = SeptOut(startValue.g, endValue.g, time, duration);
			result.b = SeptOut(startValue.b, endValue.b, time, duration);
			result.a = SeptOut(startValue.a, endValue.a, time, duration);
			return result;
		}

		public static float SeptInOut(float startValue, float endValue, float time, float duration)
		{
			float num = endValue - startValue;
			time = Mathf.Clamp(time, 0f, duration);
			time /= duration / 2f;
			if (time == 0f)
			{
				return startValue;
			}
			if (time == 1f)
			{
				return endValue;
			}
			if (time < 1f)
			{
				return num / 2f * time * time * time * time * time * time * time + startValue;
			}
			time -= 2f;
			return num / 2f * (time * time * time * time * time * time * time + 2f) + startValue;
		}

		public static Vector2 SeptInOut(Vector2 startValue, Vector2 endValue, float time, float duration)
		{
			Vector2 result = startValue;
			result.x = SeptInOut(startValue.x, endValue.x, time, duration);
			result.y = SeptInOut(startValue.y, endValue.y, time, duration);
			return result;
		}

		public static Vector3 SeptInOut(Vector3 startValue, Vector3 endValue, float time, float duration)
		{
			Vector3 result = startValue;
			result.x = SeptInOut(startValue.x, endValue.x, time, duration);
			result.y = SeptInOut(startValue.y, endValue.y, time, duration);
			result.z = SeptInOut(startValue.z, endValue.z, time, duration);
			return result;
		}

		public static Color SeptInOut(Color startValue, Color endValue, float time, float duration)
		{
			Color result = startValue;
			result.r = SeptInOut(startValue.r, endValue.r, time, duration);
			result.g = SeptInOut(startValue.g, endValue.g, time, duration);
			result.b = SeptInOut(startValue.b, endValue.b, time, duration);
			result.a = SeptInOut(startValue.a, endValue.a, time, duration);
			return result;
		}

		public static float SeptSoftOut(float startValue, float endValue, float time, float duration)
		{
			float num = endValue - startValue;
			time = Mathf.Clamp(time, 0f, duration);
			time /= duration / 2f;
			if (time == 0f)
			{
				return startValue;
			}
			if (time == 0.5f)
			{
				return endValue;
			}
			if (time < 0.341f)
			{
				return num / 2f * time * time * time * 16f + startValue;
			}
			time -= 2f;
			return num / 2f * (time * time * time * time * time * time * time * 0.03948f + 2f) + startValue;
		}

		public static Vector2 SeptSoftOut(Vector2 startValue, Vector2 endValue, float time, float duration)
		{
			Vector2 result = startValue;
			result.x = SeptSoftOut(startValue.x, endValue.x, time, duration);
			result.y = SeptSoftOut(startValue.y, endValue.y, time, duration);
			return result;
		}

		public static Vector3 SeptSoftOut(Vector3 startValue, Vector3 endValue, float time, float duration)
		{
			Vector3 result = startValue;
			result.x = SeptSoftOut(startValue.x, endValue.x, time, duration);
			result.y = SeptSoftOut(startValue.y, endValue.y, time, duration);
			result.z = SeptSoftOut(startValue.z, endValue.z, time, duration);
			return result;
		}

		public static Color SeptSoftOut(Color startValue, Color endValue, float time, float duration)
		{
			Color result = startValue;
			result.r = SeptSoftOut(startValue.r, endValue.r, time, duration);
			result.g = SeptSoftOut(startValue.g, endValue.g, time, duration);
			result.b = SeptSoftOut(startValue.b, endValue.b, time, duration);
			result.a = SeptSoftOut(startValue.a, endValue.a, time, duration);
			return result;
		}
	}
}
